Show:

Q scroller Class

Applies 'mousemove' scrolling functionality for some block element container. This algorithm doesn't require any scrollbars and any actions from the user besides (mouse|touch)move over the scrollable element. Contents of the block absolutely arbitrary. When applied, plugin wraps contents into a single 'div' block.

Constructor

Q scroller

(
  • [Object_or_String]
  • reserved1
  • reserved2
)

Parameters:

  • [Object_or_String] Mixed optional

    function could have String or Object parameter

    • [Object] Object optional

      If an Object, then it's a hash of options, that can include:

      • [height] Number optional
        If provided, container height will be restricted to this value. Optional. Otherwise container current height will be taken (useful if container already has fixed height and maybe overflow: auto / hidden)
      • [startBottom] Boolean optional
        If true, the scrollable element will be initially scrolled to the bottom of its contents.
      • [indicators] Boolean optional
        Whether to show scroll indicators (apply Q/scrollIndicators plugin).
      • [onScroll] Q.Event optional
        Q.Event or callback for handling 'onScroll' event.
    • [String] String optional

      If a string, then it's a command which may be: "remove": Destroys scroller so it won't function anymore. This command may have its own options object passed as reserved1 arg. It can include: "restoreOverflow": restores 'overlow' style of the block to the value it has before applying scroller. Defaults to true, but sometimes needed to be manually canceled. "restoreHeight": restores height of the block to the value it has before applying scroller. Defaults to true, but sometimes needed to be manually canceled. "unwrap": whether to unwrap scroller contents of the special wrapper that was previously applied to the block while applying scroller. Defaults to true, but sometimes needed to be manually canceled. "bind": Binds some event handler to the scroller event (i.e. 'onScroll'). Bind command may must have additional parameters passed as reserved1 and reserved2 args. reserved1 string. Name of the event to bind. reserved2 function or Q.Event or string function name. Handler to call when the event occurs.

  • reserved1 Mixed

    can be any type Reserved parameter, can be used differently in different situations. For example for passing event type ('on') for 'bind' command.

  • reserved2 Mixed

    can be any type Reserved parameter, can be used differently in different situations. For example for passing Q.Event or callback for 'bind' command.

Item Index